package mx.com.matersys.vacs.domain;

import java.util.Date;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.TableGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooEntity(versionField = "", table = "paciente")
public class Paciente {
	@Id
	@TableGenerator(name = "GEN_PACI", table = "sequence", pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_COUNT", pkColumnValue = "SEQ_PACI", allocationSize = 1)
	@GeneratedValue(strategy=GenerationType.TABLE, generator="GEN_PACI")
    @Column(name = "id_paciente")
    private Integer idPaciente;
	
	@ManyToMany(mappedBy = "pacientes")
    private Set<Especialista> especialistas;
    
    @OneToMany(mappedBy = "idpaciente")
    private Set<Consulta> consultas;
    
    @OneToMany(mappedBy = "idpaciente")
    private Set<Familiar> familiars;
    
    @OneToMany(mappedBy = "idpaciente")
    private Set<RegistroLectura> registroLecturas;
    
    @ManyToOne(optional = false)
    @JoinColumn(name = "idestatus", referencedColumnName = "idestatus")
    private Estatus idestatus;
    
    @ManyToOne
    @JoinColumn(name = "idplanservicio", referencedColumnName = "idplanservicio")
    private Planservicio idplanservicio;
    
    @Column(name = "altaServicio")
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(style = "M-")
    private Date altaServicio;
    
    @Column(name = "apmaterno", length = 30)
    private String apmaterno;
    
    @Column(name = "appaterno", length = 30)
    private String appaterno;
    
    @Column(name = "fechanacimiento")
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(style = "M-")
    private Date fechanacimiento;
    
    @Column(name = "nombre", length = 25)
    private String nombre;
    
    @Column(name = "direccion", length = 75)
    private String direccion;
    
    @Column(name = "email", length = 45)
    private String email;
    
    @Column(name = "telefonoCasa", length = 25)
    private String telefonoCasa;
    
    @Column(name = "telefonoMovil", length = 25)
    private String telefonoMovil;
    
    
    
}
